package com.cnebula.openapi.auth.vo;

import java.util.Arrays;

import io.vertx.core.json.JsonObject;

public class ClientApp {

	public String clientId;
	public String clientSecret;
	public String tenantID;
	public String appUrl;
	public String status;
	public String expireDate;

	public static ClientApp build(JsonObject obj) {
		
		ClientApp rst = new ClientApp();

		Arrays.asList(ClientApp.class.getDeclaredFields()).forEach(f -> {
			try {
				f.set(rst, obj.getValue(f.getName()));
			} catch (IllegalArgumentException | IllegalAccessException e) {
				e.printStackTrace();
			}
		});

		return rst;
	}
}
